CSV File Format Errors
Each complete record is a string of characters
terminated by a carriage return. The maximum permissible length of a line
is 1775 characters, excluding the terminating carriage return and any
other control characters. A longer line produces the error message:
Line too long for input buffer
The import process will abort immediately. This message may also result
from an attempt to import a non-CSV
file.
All control characters are ignored except
carriage returns.
Within a line, fields are separated by commas.
Two or more consecutive commas represent a field of zero length. A line
ending with a comma signifies another field of zero length. Blank or zero
length fields have special significance to the import utility.
Any field can be enclosed in double quotes.
These quotes must appear as the first and last characters of the field.
The error message:
quotes out of sequence
is produced if a quote is encountered in the middle of a field when this
field did not start with a quote, or if " is used in the middle of
a field enclosed in quotes.
The message:
missing comma
is produced if a closing quote is not followed immediately by a comma separator
or the end of a line.
The error:
Incomplete record
is reported if the end of the line has no closing quote and the last field
started with an opening quote.
Double quotes at the beginning or the end.
A comma appearing in a string enclosed in double quotes is considered to
be a character in that string and not a field separator. To include a
comma in a text field, the field must be enclosed in double quotes. As
the File Import routine interprets double quotes as field separators they
may not be included as part of any field, even though they are valid characters
for most account text fields.
The message:
Disk
or File Error
indicates either a disk read/write error, or incorrect or corrupt data
files. The import process aborts as soon as it encounters such an error.
At the end of pass 1, if the File Import utility
has calculated that the amount of space left on the data disk is insufficient
to store the imported data file it reports there is:
Insufficient disk space to import this file completely
If disk space runs out during the second pass then the message:
Error while writing data
is produced. This error may also occur as a result of read/write errors. In this case, the new file will only have been partially imported and the data files may not have been closed correctly. You should return to backup data and perform the import again.
The maximum number of characters in any individual
field is 255. Subsequent characters are treated as belonging to the next
field. The error message:
field too long for input buffer
will be produced. Variables in ensuing fields may appear inconsistent with expected field variables.
The message:
Disk or file access error
indicates an error reading or writing data, either due to a read/write file error or to corrupted or uninitialised data files.
If more fields appear on a line than are required
for the import in progress, the message:
too many fields
is produced.
If fewer fields appear in an input line than
are required for the import, subsequent fields are considered to be blank
or zero length fields.
The message:
invalid data for ...
covers many situations but the type of field involved is always specified. Normally this involves an inconsistent character, such as a letter in a numeric field.
The message:
out of range for ...
means that the value specified for a numeric field is outside the permitted range. The maximum value for all numeric fields, unless otherwise specified, is ten million.
Text fields are truncated if more characters
appear than are required for the field. Long fields do not produce an
error message; the extra characters are simply ignored. Imported text
variables that are shorter than the maximum allowed length are padded
with trailing spaces.
All spaces (except a leading space) and extra
characters are ignored for a customer/supplier or nominal account reference.
This is to allow flexibility when importing from files produced by other
programs that use different types of account reference. For example, importing
two identical fields:
Sage Software Limited, Sage Software Limited
as a customer fields 1 (account reference) and 2 (account name) produces:
Account Reference: SAGESOFT
Account Name: Sage Software Limited
The account reference is truncated and translated into upper case.
A blank field is left intact and does not
overwrite any information already held in the corresponding field of the
record to be written to disk. In some cases, however, a blank field is
not accepted.
The blank field is most useful when updating information in existing ledger
or product records. For example, to change the telephone number of an
existing customer account, but leave all the other information untouched,
the import line might be as follows:
SAGESO,,,,,,0191
255 3000
The account reference will call up the existing sales account SAGESO,
assuming this already exists. The five blank fields implied by the commas
after the SAGESO
entry leave the name and address fields in the SAGESO
record unchanged. However the existing telephone number in that record
is overwritten with the new variable (0191 255 3000). Since that is the
end of the import line, all the remaining fields are also regarded as
blank; they remain as they were before (i.e. turnover, analysis code,
etc. are unaltered). The updated SAGESO
sales account record is written back to disk, only the telephone number
having changed.
Note that if a blank field is encountered
that corresponds to a date field, the system date - the date you entered
in the programÆs opening screen - is substituted.
XXXXXX
is an illegal nominal code. This code is used by Sage Line 50 programs
when the month end option is used. Account references may not begin with
a space character, but after the first character subsequent space characters
are ignored. An account reference with one of these errors produces the
following error message:
illegal Nominal Ledger Account Reference
Related Topics